<?php
namespace App\Transformers;

use App\Models\Comment;
use App\Models\Report;
use App\Models\User;
use App\Models\Write;
use League\Fractal\TransformerAbstract;

class ReportTransformer extends TransformerAbstract
{
//    protected $availableIncludes = ['comment'];
    public function transform(Report $report){
        return [
            'id'                  =>$report->id,
            'user'             =>User::find($report->user_id),
            'comment'          =>Comment::find($report->comment_id),
            'be_reported_user' =>User::find($report->be_reported_user_id),
            'write'            =>Write::find($report->write_id),
            'created_at'          =>$report->created_at,
            'is_not_ok'           =>$report->is_not_ok,
        ];
    }

}
